﻿using System;
using Security.Domain;
using Security.Helpers;

namespace Security.Specs.Common
{
    internal static class Strings
    {
        private static readonly string employee;
        private static readonly string post;
        private static readonly string permission;
        private static readonly string department;
        private static readonly string login;

        static Strings()
        {
            employee = "Cотрудник";
            post = "Должность";
            permission = "Разрешение";
            department = "Отдел";
            login = "Имя входа";
        }

        public static string GetTypeDescription(Type type)
        {
            string description = string.Empty;
            type.Match(typeof (Employee), () => description = employee).
                 Match(typeof (Post), () => description = post).
                 Match(typeof (Permission), () => description = permission).
                 Match(typeof (Department), () => description = department).
                 Match(typeof (ServerLogin), () => description = login);

            return description;
        }
    }
}
